<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/User.php';
$thanhvienOb = new User();
if (isset($_SESSION['session_id_user'])) {
    $Users = $_SESSION['session_id_user'];
}
$thanhvien = $thanhvienOb->layKhachHang($Users);
$message = array();
if (isset($_GET['User'])) {
    if($thanhvienOb->capnhapTaiKhoan($_GET['User'], $_POST))
    {
        $thanhvien = $thanhvienOb->capnhapTaiKhoan($_GET['User'], $_POST);
        header('Location: index.php');
    }
    
}
    ?>
    <form method="post" action="thongtintaikhoan.php?User=<?php echo "$Users" ?>" enctype="multipart/form-data">
        <table style="margin: 10px auto" width="600" border="0" align="center" cellspacing="1">
            <tr>
                <td bgcolor="#00CCFF" colspan="2"><p align="center"><b>Thay đổi thông tin tài khoản</b></p></td>         
            </tr>
            <tr>
                <td width="200px" align="left"><b>Tên tài khoản:</b></td>
                <td><?php echo $thanhvien['UserName'] ?></td>
            </tr>
            <tr>
                <td width="200px" align="left"><b>Họ:</b></td>
                <td><input type="text" name="LastName" value="<?php echo $thanhvien['LastName'] ?>"></td>
            </tr>
            <tr>
                <td width="200px" align="left"><b>Tên:</b></td>
                <td><input type="text" name="FirstName" value="<?php echo $thanhvien['FirstName'] ?>"></td>
            </tr>
            <tr>
                <td width="200px" align="left"><b>Email:</b></td>
                <td><?php echo $thanhvien['Email'] ?></td>
            </tr>
            <tr>
                <td width="200px" align="left"><b>Số điện thoại:</b></td>
                <td><input type="text" name="PhoneNum" value="<?php echo $thanhvien['PhoneNum'] ?>"></td>
            </tr>
            <tr>
                <td width="200px" align="left"><b>Địa chỉ:</b></td>
                <td><input type="text" name="Location" value="<?php echo $thanhvien['Location'] ?>"></td>
        </tr>
        <tr>
            <td></td>
            <td align="left"><input type="submit" name="capnhat" id="capnhat" value="Cập nhật"></td>
        </tr>
    </table>
</form>